Implement save_single_paths option for Pathfinder#839
Open
amas0 wants to merge 8 commits intostan-dev:developfrom
Open
Implement save_single_paths option for Pathfinder#839amas0 wants to merge 8 commits intostan-dev:developfrom
save_single_paths option for Pathfinder#839amas0 wants to merge 8 commits intostan-dev:developfrom
Conversation
Previous implementation left num_paths as None by default. This meant it would be set as a default value of 4 by cmdstan under the hood. While functional, this meant that cmdstanpy did not explicitly know the number of paths used when running pathfinder. This made it awkward to write code that needed to know how many paths were run. By making the default explicitly 4 in cmdstanpy, this clarifies behavior at the cost of not automaticallyu inheriting any changes to default cmdstan behavior.
Member
|
Your two questions are part of why we did not implement this when first exposing pathfinder -- it's not entirely clear when users want these, and it introduces a whole ton of conditional logic into the pathfinder return and the runset. I'm still not entirely convinced it's a good idea |
Collaborator
Author
|
Yeah, and my intuition is that there's not a real need to have it bubble up to the stanfit object. I think it makes sense to include it in the runset, we do state in the docstring: It'd be a larger lift to do any processing of the resultant files, but storing a reference isn't too bad. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submission Checklist
Summary
Intends to resolve #770.
Adds a
save_singe_pathsboolean keyword argument toCmdStanModel.pathfinder, which setssave_single_paths=Truein thePathfinderArgs(this argument already existed). Also, exposes these output file locations to the user as part of theRunSet. Specifically, this adds two properties:RunSet.single_path_csv_filesandRunSet.single_path_json_filesthat will only be populated with file paths if pathfinder is run with the new flag enabled.This PR also changes slightly the cmdstanpy behavior for Pathfinder, specifically it explicitly defaults the
num_pathsargument to 4 within cmdstanpy. Previously, it defaulted toNoneandcmdstanunder the hood would default to 4 paths. This meant (as far as I could tell) that cmdstanpy didn't have any explicit reference to thenum_pathsvalue if run using defaults.Some follow-on questions I have:
RunSetbut no higher. Is there a desire to expose these files as properties on theCmdStanPathfinderclass?CmdStanPathfinder.single_path_draws()or something?Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): myself
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: